<template>
	<view class="bottomBox">
		<view class="selectedBox">
			<view class="price">
				<image v-if="icon" class="jt" :src="`${imgUrlPrefix}static/images/${icon}`" mode="widthFix"></image>
				￥<text class="num">{{price}}</text>
			</view>
		</view>
		<view class="btn" @click="onclick">订购</view>
	</view>
</template>

<script>
	import {defineComponent,reactive,toRefs,onMounted,getCurrentInstance,computed} from 'vue'
	import {onLoad,onShow} from '@dcloudio/uni-app'
	import { useStore } from 'vuex'
	import numberSelector from "@/components/numberSelector/numberSelector.vue"
	export default defineComponent({
		components:{
			numberSelector
		},
		props:{
			icon:String,
			price:''
		},
		setup(props,context) {
			const store = useStore()
			const {proxy} = getCurrentInstance()
			
			const state = reactive({
				imgUrlPrefix:getApp().globalData.imgUrlPrefix,
			})
			
			onMounted(()=>{
				
			})
			
			const onclick = ()=>{
				context.emit('onclick')
			}
			
			return {
				...toRefs(state),
				onclick
			}
		}
	})
</script>

<style lang="scss" scoped>
	.bottomBox{
		//display: flex;
		position: relative;
		z-index: 910;
		background: #fff;
		height: 100rpx;
		border-top:1px solid #f8f8f8;
		padding: 0 30rpx;
		.selectedBox{
			//flex: 1;
			float: left;
			line-height: 100rpx;
			.price{
				display: flex;
				font-size: 30rpx;
				font-weight: 600;
				color: #ff1b1b;
				.num{
					font-size: 46rpx;
				}
			}
		}
		.btn{
			float: right;
			width: 180rpx;
			height: 80rpx;
			line-height: 80rpx;
			background: #fba70e;
			border-radius:40rpx;
			font-size: 34rpx;
			font-weight: 600;
			text-align: center;
			margin: 10rpx 0 0 0;
		}
	}
</style>
